#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
#include<vector>
#include<queue>

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
};

class Solution {
public:
    vector<vector<int>> levelOrder(TreeNode* root) {
        if (root == nullptr)
        {
            return {};
        }

        vector<vector<int>> ans;
        queue<TreeNode*> q;
        q.push(root);
        while (!q.empty())
        {
            int currentLevelSize = q.size();
            ans.push_back(vector<int>());
            for (int i = 0; i < currentLevelSize; i++)
            {
                TreeNode* front = q.front();
                q.pop();
                ans.back().push_back(front->val);

                if (front->left != nullptr)
                {
                    q.push(front->left);
                }

                if (front->right != nullptr)
                {
                    q.push(front->right);
                }

            }

        }
        return ans;
    }
};

//class Solution {
//public:
//    bool _lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q, TreeNode*& grandfather) {
//        if (root == nullptr)
//            return false;
//
//        bool left = _lowestCommonAncestor(root->left, p, q, grandfather);
//        bool right = _lowestCommonAncestor(root->right, p, q, grandfather);
//
//        if ((left && right) || ((root->val == p->val || root->val == q->val) && (left || right)))
//            grandfather = root;
//        return left || right || (root->val == p->val || root->val == q->val);
//
//    }
//
//    TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
//
//        TreeNode* grandfather = nullptr;
//        _lowestCommonAncestor(root, p, q, grandfather);
//        return grandfather;
//    }
//};

int main()
{
    vector<int> v;
    v.resize(10);

    for (auto& e : v)
    {
        cin >> e;
    }


    for (auto e : v)
    {
        cout << e << ' ';
    }
    cout << endl;

    return 0;
}